// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
//import FastClick from 'fastclick'
import VueRouter from 'vue-router'
import axios from 'axios'; // 引入axios

//axios.defaults.baseURL ="http://192.168.10.136:8087"
axios.defaults.baseURL = "http://118.190.205.4:8087" //测试环境
//axios.defaults.baseURL ='http://app.ihotelvip.com/',// 生产环境
Vue.prototype.$axios = axios

import App from './App'
import '@/styles/index.css'
import router from '@/router'

import Vuex from 'vuex';
import vuexI18n from 'vuex-i18n';
import {
  AlertPlugin
} from 'vux'

//富文本编辑器
import 'font-awesome/css/font-awesome.css'
import initRichText from '@/service/initHTMLEditor';
initRichText();



if (localStorage.errCode == 10001) {
  this.$router.push({
    path: '/login'
  })
}
Vue.use(Vuex);
Vue.use(AlertPlugin)
Vue.use(VueRouter)


const store = new Vuex.Store({
  modules: {
    i18n: vuexI18n.store
  }
});
Vue.use(vuexI18n.plugin, store);
const translationsEn = {
  "content": "This is some {type} content"
};

router.beforeEach((to, from, next) => {
  window.document.title = to.meta.title;
  next()
})

// translations can be kept in separate files for each language
// i.e. resources/i18n/de.json.
// add translations directly to the application
Vue.i18n.add('en', translationsEn);

// set the start locale to use

Vue.i18n.set('en');



//FastClick.attach(document.body);

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  router,
  render: h => h(App)
}).$mount('#app-box')
